{extend name='common/_container'}
{block name="content"}
<div class="ibox float-e-margins">
<input type="hidden" name='result_id' id='result_id' value="{$info.result_id}" />
	<div class="ibox-content">
		<div class="form-horizontal" id="CodeInfoForm">
			<div class="row">
				<div class="col-sm-12">
				<!-- form start -->
					<div class="form-group">
						<label class="col-sm-2 control-label">结果：</label>
						<div class="col-sm-9">
							<select lay-ignore name="results" class="form-control chosen" multiple data-placeholder='请选择结果'  id="results">
								<option value="E" {if in_array("E",explode(',',$info.results))}selected{/if}>E</option>
								<option value="I" {if in_array("I",explode(',',$info.results))}selected{/if}>I</option>
								<option value="S" {if in_array("S",explode(',',$info.results))}selected{/if}>S</option>
								<option value="N" {if in_array("N",explode(',',$info.results))}selected{/if}>N</option>
								<option value="T" {if in_array("T",explode(',',$info.results))}selected{/if}>T</option>
								<option value="F" {if in_array("F",explode(',',$info.results))}selected{/if}>F</option>
								<option value="J" {if in_array("J",explode(',',$info.results))}selected{/if}>J</option>
								<option value="P" {if in_array("P",explode(',',$info.results))}selected{/if}>P</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">MBTI测试ID：</label>
						<div class="col-sm-9">
							<input type="text" id="mbti_id" value="{$info.mbti_id}" name="mbti_id" class="form-control" placeholder="请输入MBTI测试ID">
						</div>
					</div>
				<!-- form end -->
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			<div class="row btn-group-m-t">
				<div class="col-sm-9 col-sm-offset-1">
					<button type="button" class="btn btn-primary" onclick="CodeInfoDlg.edit()" id="ensure">
						<i class="fa fa-check"></i>&nbsp;确认提交
					</button>
					<button type="button" class="btn btn-danger" onclick="CodeInfoDlg.close()" id="cancel">
						<i class="fa fa-eraser"></i>&nbsp;取消
					</button>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/static/js/upload.js" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/plugins/layui/layui.js" charset="utf-8"></script>
<link href='__PUBLIC__/static/js/plugins/chosen/chosen.min.css' rel='stylesheet'/>
<script src='__PUBLIC__/static/js/plugins/chosen/chosen.jquery.js'></script>
<script>
layui.use(['form'],function(){});
$(function(){$('.chosen').chosen({search_contains: true})})
var CodeInfoDlg = {
	CodeInfoData: {},
	validateFields: {
	 }
}

CodeInfoDlg.collectData = function () {
	this.set('result_id').set('results').set('mbti_id');
};

CodeInfoDlg.edit = function () {
	 this.clearData();
	 this.collectData();
	 if (!this.validate()) {
	 	return;
	 }
	 var ajax = new $ax(Feng.ctxPath + "/Mbti.Result/edit", function (data) {
	 	if ('00' === data.status) {
	 		Feng.success(data.msg,1000);
	 		window.parent.CodeGoods.table.refresh();
	 		CodeInfoDlg.close();
	 	} else {
	 		Feng.error(data.msg + "！",1000);
		 }
	 })
	 ajax.set(this.CodeInfoData);
	 ajax.start();
};


</script>
<script src="__PUBLIC__/static/js/base.js" charset="utf-8"></script>
{/block}
